package pzhu.web;

import java.io.IOException;

import org.apache.http.ParseException;

public class Choice implements Runnable {
	public static String index;
	String Name = index;

	@Override
	public void run() {
		int pagedd = Integer.parseInt(WelcomeInterface.page.getText());
		switch (index) {
		case "0":
			index = "/4kfengjing/";
			break;
		case "1":
			index = "/4kmeinv/";
			break;
		case "2":
			index = "/4kyouxi/";
			break;
		case "3":
			index = "/4kdongman/";
			break;
		case "4":
			index = "/4kyingshi/";
			break;
		case "5":
			index = "/4kmingxing/";
			break;
		case "6":
			index = "/4kqiche/";
			break;
		case "7":
			index = "/4kdongwu/";
			break;
		case "8":
			index = "/4krengwu/";
			break;
		case "9":
			index = "/4kmeishi/";
			break;
		case "10":
			index = "/4kzongjiao/";
			break;
		case "11":
			index = "/4kbeijing/";
			break;
		default:
			break;
		}
		for (int i = 1; i <= pagedd; i++) {
			try {
				Page.pageDown(index, i);
			} catch (ParseException | IOException e) {
				// TODO Auto-generated catch block
				WelcomeInterface.log.append("下载：" + Name + "失败！");
				e.printStackTrace();
			}
		}
		WelcomeInterface.start.setSelected(true);
		WelcomeInterface.number.setEditable(true);
		WelcomeInterface.page.setEditable(true);
	}
}
